package org.example.feign;

import org.example.entity.Cart;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@FeignClient(name = "cart-service")
public interface CartFeignClient {
    @GetMapping("/elm-api/cart/listCart")
    List<Cart> listCart(@RequestParam("userId") String userId, @RequestParam("businessId") Integer businessId);

    @PostMapping("/elm-api/cart/saveCart")
    int saveCart(@RequestParam("foodId") Integer foodId, @RequestParam("businessId") Integer businessId,
            @RequestParam("userId") String userId, @RequestParam("quantity") Integer quantity);

    @PutMapping("/elm-api/cart/updateCart")
    int updateCart(@RequestParam("cartId") Integer cartId, @RequestParam("quantity") Integer quantity);

    @DeleteMapping("/elm-api/cart/removeCart")
    int removeCart(@RequestParam("userId") String userId, @RequestParam("businessId") Integer businessId,
            @RequestParam(value = "foodId", required = false) Integer foodId);
}